///////////////////////////////////////////////////////////
//  Task.cs
//  Implementation of the Class Task
//  Created on:      15-Nov-2009 12:32:14
//  Original author: n.gavrikov
///////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace TeamTasker.Contracts
{
    [DataContract]
    public partial class Task : BaseEntity
    {
        [DataMember]
        public string Summary { get; set; }

        [DataMember]
        public string Details { get; set; }

        [DataMember]
        public double Estimation { get; set; }

        [DataMember]
        public long ParentTaskID { get; set; }

        [DataMember]
        public string ParentTaskName { get; set; }

        [DataMember]
        public TaskPriority Priority { get; set; }

        [DataMember]
        public TaskStatus Status { get; set; }

        [DataMember]
        public DateTime? BaselineStartDate { get; set; }

        [DataMember]
        public DateTime? BaselineEndDate { get; set; }

        [DataMember]
        public DateTime? ActualStartDate { get; set; }

        [DataMember]
        public DateTime? ActualEndDate { get; set; }

        [DataMember]
        public long AssignedUserID { get; set; }

        [DataMember]
        public string AssignedUserName { get; set; }

        [DataMember]
        public DateTime? AssignmentDate { get; set; }

        [DataMember]
        public int UserAllocationPercentage { get; set; }

        [DataMember]
        public bool IsAssignmentApproved { get; set; }

        [DataMember]
        public DateTime? AssignmentApprovalDate { get; set; }

        [DataMember]
        public long AssignmentApprovedBy { get; set; }

        [DataMember]
        public string AssignmentApprovedByName { get; set; }

        [DataMember]
        public bool IsOwnerShipGranted { get; set; }
        
        [DataMember]
        public IList<TaskHistoryEntry> History { get; private set; }

        [DataMember]
        public IList<TaskWorkLogEntry> WorkLog { get; private set; }

        [DataMember]
        public IDictionary<long, string> Predecessors { get; private set; }
    }
}
